<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>ztree</title>

    <!-- Bootstrap -->
    <link href=.../../statics/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href=.../../statics/css/font-awesome.min.css" rel="stylesheet"> 
	
	<!-- Custom Theme Style -->
    <link href=.../../statics/css/custom.css" rel="stylesheet"> 
    <!-- ztree -->
    <link href=.../../statics/plugins/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"> 
  </head>

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
         
        <!-- page content -->
        <div class="framebody" role="main" >
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3>ztree</h3>
              </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">

              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_content">
 					<form class="form-horizontal form-label-left">
                  		<div class="item form-group">
                  			<label class="control-label col-md-1">下拉框树：</label>
	                        <div class="col-md-2">
	                        	<input id="combTree" name="parentArea" type="text" />
	                        </div>
	                        <div class="col-md-2">
	                        	<a id="btnGetValue" class="btn btn-primary">获取值</a>
	                        	<a id="btnGetText" class="btn btn-primary">获取文本</a>
	                        </div>
                  		</div>
                  	</form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->

        
      </div>
    </div>
    
    <!-- jQuery -->
    <script src=.../../statics/js/jquery.1.11.3.min.js"></script>
    <!-- Bootstrap -->
    <script src=.../../statics/js/bootstrap.min.js"></script>    
    <!-- ztree -->
    <script src=.../../statics/plugins/zTree/js/jquery.ztree.all-3.5.min.js"></script>   
    <script src=.../../statics/json/region.js"></script>  
    <script src=.../../statics/js/jquery-ztree-combobox-1.0.0.js"></script>
    <!-- Custom Theme Scripts -->
    <script src=.../../statics/js/custom.js"></script>
		
	<script>
		//最简便调用方式
		//$('#combTree').comboboxTree();
		//自定义参数
		$('#combTree').comboboxTree({
			url: '',
			//param: [], //请求参数
			idKey: 'id', //下拉框树节点id，默认值为id
	        pIdKey: 'pid', //下拉框树节点父id，默认值为pid
	        rootPId: "0", //根节点值,默认值为0
	        nameKey: 'name', //文本key
	        defaultValue: null //初始默认值
		});
		//获取value值
		$('#btnGetValue').on('click', function(){
			alert($('#combTree').comboboxTree('getValue'));
		})
		//获取文本值 
		$('#btnGetText').on('click', function(){
			alert($('#combTree').comboboxTree('getText'));
		})
	</script>
  </body>
</html>